﻿@model IEnumerable<XSTDZ.ERP.Application.DataContracts.OperationDto>
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
   <title>@XSTDZ.ERP.Infrastructure.SystemConfig.SystemName</title>
    @Styles.Render("~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css")
    @Scripts.Render("~/Scripts/jquery-1.7.1.min.js")
    @Scripts.Render("~/Scripts/ligerUI/js/ligerui.min.js")    <script src="@Url.Content("~/Scripts/ligerUI/js/plugins/ligerToolBar.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //布局
            $("#containerlayout").ligerLayout({ leftWidth: 200, bottomHeight: 24, onHeightChanged: f_heightChanged });
            var height = $(".l-layout-center").height();
            //Tab
            $("#framecenter").ligerTab({ height: height });
            tab = $("#framecenter").ligerGetTabManager();
            $("#pageloading").hide();
            //面板
            $("#accordion1").ligerAccordion({ height: height - 24, speed: null });
            $(".l-link").hover(function () {
                $(this).addClass("l-link-over");
            }, function () {
                $(this).removeClass("l-link-over");
            });

            //toolbar
            intiToobar();
        });
        var tab = null;
        function f_heightChanged(options) {
            if (tab)
                tab.addHeight(options.diff);
//            if (accordion && options.middleHeight - 24 > 0)
//                accordion.setHeight(options.middleHeight - 24);
        }
        function f_addTab(tabid, text, url) {
            tab.addTabItem({ tabid: tabid, text: text, url: url });
        }
        //exit Application
        function f_exitApp() {
            $.ligerDialog.confirm('确定要退出系统吗？', function (yes) {
                if (yes == true) {
                    $.get("../Account/Logout", {}, function (data) { if (data == "9") { window.close(); window.location.href = '../Account/Login'; } });
                } else { return; }
            });
        }
        //toolbar   navtab.reload(navtab.getSelectedTabItemID());
        function intiToobar() {
            $("#toptoolbar").ligerToolBar({ items: [
                { text: '首页', click: function (item) { tab.selectTabItem("home"); }, img: '../Content/images/application_home.png' },
                { line: true },
//                 { text: '刷新当前', img: '../Content/images/table_refresh.png', click: function () { tab.reload(navtab.getSelectedTabItemID()); } },
//                { line: true },
                { text: '关闭所有', img: '../Content/images/application_cascade.png', click: function () { tab.removeAll(); } },
                { line: true },
                { text: '关闭当前', img: '../Content/images/application_delete.png', click: function () { if (tab.getSelectedTabItemID() != "home") { tab.removeTabItem(tab.getSelectedTabItemID()); } } },
                 { line: true },
                { text: '退出系统', img: '../Content/images/application_go.png', click: function () { f_exitApp(); } }
            ]
            });
        }
       
     </script>
     <style type="text/css"> 
  
   #pageloading{position:absolute; left:0px; top:0px; /*background:white url('../Content/images/loading.gif') no-repeat center;*/ width:100%; height:100%;z-index:99999;}     .l-link{ display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;}
    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;} 

    /* 顶部 */ 
    #topmenu,#toptoolbar{width:100%;}
    .l-topmenu{ margin:0 0 10px 0; padding:0;   height:66px; line-height:66px;  position:relative;  }
    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px;  font-size:26px; font-weight:bold;}
    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:0; top:42px;color:#070A0C;}
    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:none;}     #toptoolbar{ margin:5px 0;}
    #accordion1 div.l-accordion-header{ background: url('../Content/images/bullet_red.png') no-repeat 5px 4px, url('../Scripts/ligerUI/skins/Aqua/images/layout/accordion-header.gif') repeat-x 10px 0; padding-left:30px;}
    #accordion1 a,#accordion1 a:link,#accordion1 a:visited{ text-decoration:none; font-size:12px; color:#183152;}
    #accordion1 a img{ float:left; margin:2px 2px 0 0;}
    
    #l-topmenu-weather{ position:absolute; z-index:9999; top:-3px; left:400px; height:70px; }
    div.julying-weather{ position:absolute; z-index:9999; top:0px; left:400px; height:70px;width:100px;}
    div.julying-weather div.sky-1,div.julying-weather .sky .child-0{ left:40px; top:10px; height:60px;}
    #userloginInfo{ position:absolute; z-index:9999;  right:470px; top:46px; height:20px; line-height:20px; font-size:14px; color:#D6E3EF;}
     </style>
</head>
<body class="indexbody">
   <div id="pageloading"></div>  
   <div id="topmenu" class="l-topmenu">
            <div class="l-topmenu-logo"><img src="../Content/images/indexlogo.png" alt="" style=" position:absolute; top:-1px; "  />@*@XSTDZ.ERP.Infrastructure.SystemConfig.SystemName*@</div>
            <div id="l-topmenu-weather">
               @* <iframe src="http://m.weather.com.cn/m/pn12/weather.htm " width="245" height="70"  
            marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"  scrolling="no"></iframe> *@
            @*http://julying.com/lab/weather/ 这里是天气预报文档*@
            @*<script defer src="http://julying.com/lab/weather/v3/jquery.weather.build.min.js?parentbox=body&moveArea=limit&zIndex=-1&move=0&drag=1&autoDrop=0&styleSize=big&style=default&area=client&city=%E6%88%90%E9%83%BD"></script>*@
            </div>
            <div class="l-topmenu-welcome">
                  <div id="toptoolbar" style="margin-top:3px;"></div>
            </div> 
            <div id="userloginInfo">@ViewBag.LoginName 欢迎您!</div>
             
        </div>

        
    <div id="containerlayout">
           <div  position="left"  title="菜单列表">
           <div id="accordion1" > 
                 @*<div title="系统菜单">
                      <ul>
                            <li><a class="l-link" href="javascript:f_addTab('resourceManage','系统资源管理','@Url.Action("Authoriztion", "Permission")')"><img src="../Content/images/bullet_blue.png" alt="" />系统资源管理</a>  </li>
                            <li><a class="l-link" href="javascript:f_addTab('menueManage','系统菜单管理','@Url.Action("Index", "Operation")')"><img src="../Content/images/bullet_blue.png" alt="" />系统菜单管理</a></li>
                             <li><a class="l-link" href="javascript:f_addTab('roleManage','角色管理','@Url.Action("Index", "Role")')"><img src="../Content/images/bullet_blue.png" alt="" />角色管理</a></li>
                            <li><a class="l-link" href="javascript:f_addTab('orgManage','组织机构管理','@Url.Action("List", "Org")')"><img src="../Content/images/bullet_blue.png" alt="" />组织机构管理</a></li>
                            <li><a class="l-link" href="javascript:f_addTab('userManage','用户管理','@Url.Action("Index", "User")')"><img src="../Content/images/bullet_blue.png" alt="" />用户管理</a></li>
                            <li><a class="l-link" href="javascript:f_addTab('refeManage','字码表管理','@Url.Action("Index", "Refe")')"><img src="../Content/images/bullet_blue.png" alt="" />字码表管理</a></li>
                        </ul>
                </div>*@
                @{int index = 0;}
                @foreach (var pannel in Model.Where(m => m.Id == m.ParentId))
                {
                    index++;
                    var i = 0;
                   <div title="@pannel.OperationName">
                         <ul>
                            @foreach(var menuitem in Model.Where(m=>m.ParentId==pannel.Id&&m.Id!=m.ParentId))
                            {
                                i++;
                                <li><a class="l-link" href="javascript:f_addTab('@index.ToString()@i.ToString()','@menuitem.OperationName','@Url.Action(@menuitem.PermissionDto.Action, @menuitem.PermissionDto.Controller)')">
                                @if (!string.IsNullOrEmpty(menuitem.IconUrl))
                                { <img src="@menuitem.IconUrl" alt="@menuitem.OperationName" title="@menuitem.OperationName" />}@menuitem.OperationName.Trim()</a></li>
                            }
                         </ul>
                   </div>
                }
            </div>  
           </div>
            <div position="center" id="framecenter">
                <div tabid="home" title="我的主页" style="height:300px" >
                    <iframe frameborder="0" name="home" id="home" src="../Home/Welcome"></iframe>
                </div> 
            </div>
            <div position="bottom">
               <p> Copyright © 2013 成都鑫首创科技有限公司    技术支持   </p>
            </div>
        </div> 
</body>
</html>